package flca.voicenav.model;

import com.google.android.maps.GeoPoint;

import android.location.Location;

public class TracePt  {

	private Location location;
	private int nextCorner = -1;
	private int prevCorner = -1;
	private int nextDist = 0;
	private int prevDist = 0;
	private int minDist = 0;
	private int arrayIndex = 0;// nr in coordinates arraylist
	private int segmIndex = 0; // nr of corr segment of route
	private Dir direction = Dir.UNKNOWN;
	
	public TracePt(Location location)
	{
		super();
		this.location = location;
	}

	
	public int getNextCorner() {
		return nextCorner;
	}


	public void setNextCorner(int nextCoord) {
		this.nextCorner = nextCoord;
	}


	public int getPrevCorner() {
		return prevCorner;
	}


	public void setPrevCorner(int prevCoord) {
		this.prevCorner = prevCoord;
	}


	public int getNextDist() {
		return nextDist;
	}


	public void setNextDist(int distToNext) {
		this.nextDist = distToNext;
	}


	public int getPrevDist() {
		return prevDist;
	}


	public void setPrevDist(int distToPrev) {
		this.prevDist = distToPrev;
	}


	public int getMinDist() {
		return minDist;
	}


	public void setMinDist(int minDist) {
		this.minDist = minDist;
	}

	public Location getLocation() {
		return location;
	}


	public double lat() {
		return location.getLatitude();
	}
	
	public double lon() {
		return location.getLongitude();
	}

	
	public Dir getDirection()
	{
		return direction;
	}


	public void setDirection(Dir direction)
	{
		this.direction = direction;
	}


	public void setLocation(Location location)
	{
		this.location = location;
	}


	public GeoPoint geoPoint() {
		return new GeoPoint((int) (lat() * 1E6), (int) (lon() * 1E6));
	}
	
	
	public int getSegmIndex() {
		return segmIndex;
	}


	public void setSegmIndex(int segmIndex) {
		this.segmIndex = segmIndex;
	}

	

	public int getArrayIndex()
	{
		return arrayIndex;
	}

	void setArrayIndex(int arrayIndex)
	{
		this.arrayIndex = arrayIndex;
	}


	@Override
	public String toString()
	{
		return "TracePt [segm=" + segmIndex + ", fromCoord=" + prevCorner + ", toCoord=" + nextCorner + ", distToCoord=" + nextDist + ", minDist=" + minDist + ", status=" + direction + "]";
	}
	
	
	
}
